﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Easyui扩展库 validatebox - 落阳 整理</title>
    <link href="http://www.easyui-extlib.com/Content/Site.css" rel="stylesheet" />
    <script src="http://www.easyui-extlib.com/Scripts/jquery/jquery-1.11.0.min.js"></script>
    <script src="http://www.easyui-extlib.com/Scripts/jquery-extensions/jquery.jdirk.js"></script>
    <link href="http://www.easyui-extlib.com/Scripts/jquery-easyui/jquery-easyui-1.4.3/themes/default/easyui.css" rel="stylesheet" />
    <link href="http://www.easyui-extlib.com/Scripts/jquery-easyui/jquery-easyui-1.4.3/themes/icon.css" rel="stylesheet" />
    <script src="http://www.easyui-extlib.com/Scripts/jquery-easyui/jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
    <script src="http://www.easyui-extlib.com/Scripts/jquery-easyui/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js"></script>

    <link href="http://www.easyui-extlib.com/Scripts/jquery-easyui-extensions/validatebox/jeasyui.extensions.validatebox.css" rel="stylesheet" />
    <script src="http://www.easyui-extlib.com/Scripts/jquery-easyui-extensions/validatebox/jeasyui.extensions.validatebox.rules.js"></script>
    <script src="http://www.easyui-extlib.com/Scripts/jquery-easyui-extensions/validatebox/jeasyui.extensions.validatebox.updateRules.js"></script>
    <script>
    $(function () {
        $("#btn1").click(function () {
            $("#t1").validatebox("addValidType", "integer").focus();
        });
        $("#btn2").click(function () {
            $("#t1").validatebox("removeValidType", "integer").focus();
        });

        $("#btn3").click(function () {
            $("#t1").validatebox("addValidType", ["integer", "mobile"]).focus();
        });
        $("#btn4").click(function () {
            $("#t1").validatebox("removeValidType", ["integer", "mobile"]).focus();
        });
    });
    </script>
</head>
<body>
    <div class="easyui-panel" data-options="fit:true" style="padding:25px;">
        <input id="t1" name="t1" class="easyui-validatebox" data-options="required:true" />
        <br /><br />
        <a id="btn1" class="easyui-linkbutton" data-options="iconCls:'icon-add'">增加“数字规则”</a><br />
        <a id="btn2" class="easyui-linkbutton" data-options="iconCls:'icon-remove'">移除“数字规则”</a>

        <br /><br /><br />
        <a id="btn3" class="easyui-linkbutton" data-options="iconCls:'icon-add'">增加“数字、手机号码规则”</a><br />
        <a id="btn4" class="easyui-linkbutton" data-options="iconCls:'icon-remove'">移除“数字、手机号码规则”</a>
    </div>
</body>
</html>
